<template>
  <div>
    <h2>正在测试Pinia的使用</h2>
    <p v-color2:font="'#f0f'">状态：{{ n }}</p>
    <p>状态：{{ doubleN }}</p>
    <input type="button" @click="change" value="+1">
  </div>
</template>

<script setup>
import { computed, ref } from "vue";
import { useTestStore } from "../../storesPinia/index.js"

const testStore = useTestStore();


const n = computed(()=>{
  return testStore.n;
})
const doubleN = computed(()=>{
  return testStore.doubleN;
})

function change(){
  testStore.changeN();
}

const m = ref(0);
console.log(testStore.n)
console.log(m);
console.log(n);

</script>